package tests;

import java.sql.SQLException;
import java.util.ArrayList;

import dbaccess.BddManager;

public class TestDB {

	/**
	 * @param args
	 * @throws Exception 
	 */
	public static void main(String[] args) throws Exception {
		//BddManager.getInstance().disconnectBdd();
		//BddManager.getInstance().saveUser("Test9", "NewPass", "professeur", "mail","admin");
//		BddManager.getInstance().saveUser("Test7", "Test", "cocorico","P2");
		//System.out.println(BddManager.getInstance().checkPasswordProvider("NomProvider6", "Password"));
		//System.out.println(BddManager.getInstance().getVMFromUser("Toto"));
		//System.out.println(BddManager.getInstance().getRole("Test2"));
		//System.out.println(BddManager.getInstance().getSubnetFromUser("tedsqst"));
		//System.out.println(BddManager.getInstance().getProviderUrl());
		//System.out.println(BddManager.getInstance().getTemplate("cocoLePdrovider"));
//		System.out.println(BddManager.getInstance().getUserRoles("TestProvider2"));
		ArrayList<String> listeDeService = new ArrayList<String>();
			for(int j=5;j<7;j++){
				listeDeService.add("COOCO"+j);
			}
		//BddManager.getInstance().setServices("EssaiProvider", listeDeService);*/
//		BddManager.getInstance().saveVM("Toto", "Titi", "125.258.256.33", "azert");
		//BddManager.getInstance().saveVM("Toto", "Titi", "125.258.256.33", "azert", 5, 5, 7, "coco", 4);
		
		//BddManager.getInstance().saveProvider("NomProvidersgt","mail@mail", "URLURLURL4", listeDeService, listeDeService, "Password");
//		BddManager.getInstance().saveUser("ESNUIE", "ESNUIE", "ESNUIE");
		//BddManager.getInstance().deleteVM("Toto", 3);
		//BddManager.getInstance().addVMInSubnet(1, 7);
//		BddManager.getInstance().setVmState(3, "ON");
//		System.out.println(BddManager.getInstance().getVmState(3));
		//System.out.println(BddManager.getInstance().getUser("Test6"));
//		System.out.println(BddManager.getInstance().getServices("EssaiProvider"));
//		System.out.println(BddManager.getInstance().getService());
		//System.out.println(BddManager.getInstance().getServiceCarac("SS"));
	//	System.out.println(BddManager.getInstance().getAllServiceCarac());
		//BddManager.getInstance().addCaracToService("SSS", "CPU", "0", "40", "false");
	//	System.out.println(BddManager.getInstance().getProviderMail("NomProvider5"));
		//BddManager.getInstance().addService("Grosest14", "GrosTest", "58", "GrosTest", "GrosTest", "GrosTest", listeDeService, "GrosTest", listeDeService, "25", "GrosTest", "25", "GrosTest", "GrosTest", "32", "GrosTest", "GrosTest", "GrosTest", "GrosTest", "GrosTest", "GrosTest","Provider");
		//System.out.println(BddManager.getInstance().getService("Grosest13"));
		//System.out.println(BddManager.getInstance().getAllServiceFromProvider("TESTTEST"));
		//System.out.println(BddManager.getInstance().getAllService());
		//System.out.println(BddManager.getInstance().getUser("Test"));
		//System.out.println(BddManager.getInstance().getAllVMFromLogin("GOODTEST"));
		//BddManager.getInstance().saveSubnet("TestSubnet", "Toto", 5);
		//System.out.println(BddManager.getInstance().getSubnetFromUser("Toto"));
		//System.out.println(BddManager.getInstance().getVMFromProviderID(4,"COCO"));
		//BddManager.getInstance().deleteVM(9);
		//System.out.println(BddManager.getInstance().getProvider("NomProvider6"));
		//System.out.println(BddManager.getInstance().getAllVMFromLogin("MOCK2","etudiant"));
		//BddManager.getInstance().updateVM(10, "TOTO", "TOTO", "TOTO", 25, 25, 25, "TOTO", 25, "OFF", 5);
		//System.out.println(BddManager.getInstance().getAdminOrProfFromUser("MOCK2", "admin"));
		//BddManager.getInstance().saveEndpoint("Coco", "N3", "C3");
		//System.out.println(BddManager.getInstance().getAllEndpoint("Coco"));
		//BddManager.getInstance().saveVM("COCOCIOGGG", "COCOCIOGGG", "COCOCIOGGG", "COCOCIOGGG", 99, 99,99,"COCOCIOGGG",99,99);
		BddManager.getInstance().addService("YOUHOU","TOTOTOTOTOTO",
				"TOTOTOTOTOTO","TOTOTOTOTOTO","TOTOTOTOTOTO",
				"TOTOTOTOTOTO", listeDeService,
				"TOTOTOTOTOTO", listeDeService,
				"TOTOTOTOTOTO", "TOTOTOTOTOTO", "TOTOTOTOTOTO",
				"55","55", "55",
				"55", "5", "5",
				"TOTOTOTOTOTO", "TOTOTOTOTOTO", "TOTOTOTOTOTO","YOUHOU");
		System.out.println(BddManager.getInstance().getAllServiceFromProvider("YOUHOU"));
		
	}

}
